package cn.edu.live.dao;

import java.util.List;

import cn.edu.live.model.LiveRoom;

public class ActivityDao {

	/**
	 * 查询所有处于该状态的直播间
	 * 
	 * @param status
	 * @return
	 */
	public List<LiveRoom> findAllActByStatus(int status) {
		String sql = "select * from liveroom where status = ?";
		return LiveRoom.dao.find(sql, status);
	}

	/**
	 * 根据id查找直播间
	 * 
	 * @param id
	 * @return
	 */
	public LiveRoom findActById(int id) {
		return LiveRoom.dao.findById(id);
	}

	/**
	 * 根据activityId查找直播间
	 * 
	 * @param activityId
	 * @return
	 */
	public LiveRoom findActByActId(String activityId) {
		String sql = "select * from liveRoom where activityId = ?";
		return LiveRoom.dao.findFirst(sql, activityId);
	}

	/**
	 * 根据直播用户查到所有的历史视频
	 * 
	 * @param anchorId
	 * @return
	 */
	public List<LiveRoom> findAllActByAnchor(int anchorId) {
		String sql = "select * from liveroom where anchorid = ?";
		return LiveRoom.dao.find(sql, anchorId);
	}

	public List<LiveRoom> queryActByStus() {
		return null;
	}

}
